export function jsonToModelClass<T>(
  json: any,
  ModelClass: new (...args: any[]) => T,
): T {
  const instance = Object.create(ModelClass.prototype);
  return Object.assign(instance, json);
}

export function jsonToModel<T>(json: any, model: T): T {
  return { ...model, ...json };
}
